package com.example.springboot.bean;

import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.sql.Timestamp;
import java.util.List;

@Data
public class User {

    public Integer id;
    @NotNull(message = "账号不能为空")
    @NotEmpty(message = "账号不能为空")
    @Length(min = 2, max = 20 ,message = "账号长度必须是2~20个字符")
    public String name;
    @NotNull(message = "密码不能为空")
    @NotEmpty(message = "密码不能为空")
    @Length(min = 6, max = 12 ,message = "密码长度必须是6~12个字符")
    public String pwd;
    @Email
    public String email;
    public String head;
    public String phone;
    public Timestamp intime;
    public Integer level;

    // 定义未读公告
    private List<Notify> unreads;

}
